<?
include('custom/metatabs.php');
$cheatPoints = $this->user->localRecord['u_cheatpoints'];

function CheatLink($type)
{
  global $config;
  ob_start();
  ?><div align="center">
  only<br/>
  <b><?= $config['cheat'][$type]['cost'] ?></b><br/> Cheat Points<br/</div></td><td valign="top">
  <a class="linkbutton" href="<?= actionUrl('cheat', 'meta', 'type='.$type) ?>">buy</a>
  <?
  return(ob_get_clean());
}

?>
<h3>You have <?= $cheatPoints.' '.makePlural('Cheat Point', cheatPoints) ?></h3>
&nbsp;&nbsp;<a href="<?= actionUrl('invite', 'party') ?>">Earn more delicious Cheat Points by inviting people to your adventuring party!</a>
<div class="textblock">

</div>
<?
if (isset($this->cheatMessage))
  print('<div class="banner">'.$this->cheatMessage.'</div>');
?>
<table>
  <tr><td></td><td colspan="10"><h4 style="border-bottom: 1px solid gray;">Full Health</h4></td></tr>
  <tr>
    <td valign="top" width="*"></td>
    <td valign="top" width="350" valign="top">
      How about a full heal? All your HP could be restored
      in one swift stroke!
    </td>
    <td valign="top" width="*" valign="top">
      <?= cheatLink('HP') ?>
    </td>
  </tr>
  <tr><td></td><td colspan="10"><h4 style="border-bottom: 1px solid gray;">Replenish Action Points</h4></td></tr>
  <tr>
    <td valign="top" width="*"></td>
    <td valign="top" width="350" valign="top">
      You could have full AP right now, how does that sound?
      Think about
      all the things you could accomplish right away!
    </td>
    <td valign="top" width="*" valign="top">
      <?= cheatLink('AP') ?>
    </td>
  </tr>
  <tr><td></td><td colspan="10"><h4 style="border-bottom: 1px solid gray;">Shiny Gold Pieces!</h4></td></tr>
  <tr>
    <td valign="top" width="*"></td>
    <td valign="top" width="350" valign="top">
      Would you like <b><?= $this->character->level*250 ?></b> Gold Pieces of 
      in-game cash? Think of all the wonderful items!
    </td>
    <td valign="top" width="*" valign="top">
      <?= cheatLink('GP') ?>
    </td>
  </tr>
  <tr><td></td><td colspan="10"><h4 style="border-bottom: 1px solid gray;">Give Yourself a Bonus</h4></td></tr>
  <tr>
    <td valign="top" width="*"></td>
    <td valign="top" width="350" valign="top">
      Three character progression points! It's as if you levelled up,
      but without the usual legwork.
    </td>
    <td valign="top" width="*" valign="top">
      <?= cheatLink('CP') ?>
    </td>
  </tr>
</table>
